import static org.junit.Assert.*;
import java.util.HashMap;
import java.util.Map;

import org.junit.Test;

import edu.gatech.wheresmystuff.model.LoginModel;
import edu.gatech.wheresmystuff.model.User;
import edu.gatech.wheresmystuff.model.ILogin;

/**
 * Tests unlockAccount() and setAdmin() methods of LoginModel.
 * 
 * @author Kevin DeMuro
 *
 */
public class KevinTest {
	
	private ILogin model = new LoginModel(null);
	private Map<String, User> usermap = new HashMap<String, User>();
	private User user = new User();
	
	public KevinTest() {
		user.setUsername("rawr");
		user.setTries(0);
		usermap.put("rawr", user);
	}
	
	@Test
	public void testModel() {
		assertTrue(usermap.get("rawr").equals(user));
		try {
			model.unlockAccount("rawr", usermap);
		} catch (NullPointerException e) {}
		try {
			model.setAdmin("rawr", usermap);
		} catch (NullPointerException e) {}
		assertTrue(usermap.get("rawr").isAdmin());
		assertTrue(usermap.get("rawr").getTries() == 3);
	}
}
